setDisplayFormat Method(DateFormat) |
Sets the display format for the date. If nothing is passed, by default the shortdate is set as display format.
Syntax
dateFormatObj.setDisplayFormat(sFormat)
Parameters
Parameter |
Description |
---|---|
sFormat |
Required. Display format for the date in the form of string. |
Return Value
No return value
Example
The following example displays how this method is used.
importType("wcp.library.util.LocaleFormat"); importType("wcp.library.util.DateFormat"); var dateFormat = new DateFormat(sFormat, localeName, elmt); dateFormat.setDisplayFormat("longdate");